<%@page import="com.system.dao.RoleDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="ui" uri="http://com.am.tag"%>
<%@ include file="../common.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'userEdit.jsp' starting page</title>
    
    <script type="text/javascript">
    
	    $().ready(function(){
			
			var map = Dialog.getInstance("view").getParam("param");
			if(map != null)
			{
				Form.bindForm("winForm",map);
			}
		});
	
    	
    	function doSave()
    	{
    		if(doCheck())
    		{
    			var map = Form.formToBean("winForm");
        		ajax.remoteCall("com.system.dao.PersonDao:update",[map],function(reply){
        			var result = reply.getResult();
        			alert(result.value);
        			if(result.type == "success")
        			{
        				var dlg = Dialog.getInstance("view");
        	    		dlg.getParam("window").mygrid.reload();
        	    		dlg.close();
        			}
        		});
    		}
    	}
    	
    	function doCheck()
    	{
    		if($("#type").val() == "")
    		{
    			alert("请选择类型");
    			return false;
    		}
    		
    		if($("#campus").val() == "")
    		{
    			alert("请选择所属校区");
    			return false;
    		}
    		return true;
    	}
    </script>
  </head>
  
  <body style="overflow: hidden;">
   <center>
   <form id="winForm" name="winForm">
   		<input type="hidden" name="id">
  		<table border="0" cellpadding="0" cellspacing="0" style="margin-top: 10px">
			<tr height="40px">
				<td width="100px" align="right"><font color="#FF0000">*</font>&nbsp;姓名：</td>
				<td width="140px"><input id="name" name="name" type="text" class="textbox" style="width: 140px"/></td>
				
				<td width="100px" align="right">出生日期：</td>
				<td width="140px">
					<ui:DateTimePicker id="birthday" name="birthday" style="width: 140px" dateFormat="yyyy-MM-dd"></ui:DateTimePicker>
				</td>
				<td width="80px" align="right">性别：</td>
				<td width="100px">
					<input name="sex" type="radio" value="男" checked/>男&nbsp;&nbsp;&nbsp;
					<input name="sex" type="radio" value="女"/>女
				</td>
			
			</tr>
			<tr height="40px">
				<td width="100px" align="right">联系电话：</td>
				<td width="140px"><input id="telephone" name="telephone" type="text" class="textbox" style="width: 140px"/></td>
				<td width="100px" align="right">住址：</td>
				<td width="140px"><input id="address" name="address" type="text" class="textbox" style="width: 140px"/></td>
				
				<td width="80px" align="right"><font color="#FF0000">*</font>类型：</td>
				<td width="100px">
					<select id="type" name="type" style="width: 100px">
						<option value="">--请选择--</option>
						<option value="0">学生</option>
						<option value="1">教职工</option>
						<option value="2">退休</option>
						<option value="3">离休</option>
						<option value="4">其他</option>
					</select>
				</td>
			</tr>
			<tr height="40px">
				<td width="100px" align="right">证件号：</td>
				<td width="140px"><input id="id_card" name="id_card" type="text" class="textbox" style="width: 140px"/></td>
				<td width="100px" align="right">学号/工资卡号：</td>
				<td width="140px"><input id="num" name="num" type="text" class="textbox" style="width: 140px"/></td>
				<td width="80px" align="right"><font color="#FF0000">*</font>校区：</td>
				<td width="100px">
					<select id="campus" name="campus" style="width: 100px">
						<option value="">--请选择--</option>
						<option value="校本部">校本部</option>
						<option value="白云校区">白云校区</option>
						<option value="北校区">北校区</option>
						<option value="西校区">西校区</option>
					</select>
				</td>
			</tr>
			<tr height="40px">
				<td width="100px" align="right">医疗卡号：</td>
				<td width="140px"><input id="card_num" name="card_num" type="text" class="textbox" style="width: 140px"/></td>
				<td width="100px" align="right">班级/部门：</td>
				<td width="320px" colspan="3">
					<input id="class" name="class" type="text" class="textbox" style="width: 320px"/>
				</td>
			</tr>
			<tr height="40px">
				<td width="100px" align="right">社保编号：</td>
				<td width="140px"><input id="social_security" name="social_security" type="text" class="textbox" style="width: 140px"/></td>
				<td width="100px" align="right">既往病史：</td>
				<td colspan="6">
					<input id="anamnesis" name="anamnesis" type="text" class="textbox" style="width: 320px"/>
				</td>
			</tr>
			<tr height="40px">
				<td width="100px" align="right">状态：</td>
				<td width="140px">
					<select id="status" name="status" style="width: 140px">
						<option value="">--请选择--</option>
						<option value="1">在册</option>
						<option value="0">不在册</option>
					</select>
				</td>
				<td width="100px" align="right">选点医院：</td>
				<td colspan="6"><input id="choose_hospital" name="choose_hospital" type="text" class="textbox" style="width: 320px"/></td>
			</tr>
			<tr height="40px">
				<td width="100px" align="right">是否省公医：</td>
				<td width="140px">
					<input id="is_public_medicine" name="is_public_medicine" type="text" class="textbox" style="width: 140px"/>
				</td>
				<td width="100px" align="right">备注：</td>
				<td colspan="6"><input id="notes" name="notes" type="text" class="textbox" style="width: 320px"/></td>
			</tr>
  		</table>
	</form>
	</center>
  </body>
</html>
